package main

import "fmt"

type Student struct {
	id   int
	name string
	sex  string
	age  int
	addr string
}

func main() {
	d := map[int]string{2: "bar"}
	d[1] = "for"
	fmt.Println("d=", d)

	a := make(map[int]string)
	a[1] = "foo"
	a[100] = "bar"
	a[1] = "jee"
	fmt.Println(a)

	if v, ok := a[1]; ok {
		fmt.Println(v)
	} else {
		fmt.Println("不存在的key")
	}

	var s Student
	s.id = 1
	s.name = "zs"
	s.sex = "男"
	s.age = 18
	s.addr = "foo"
	fmt.Println(s)

	b := Student{id: 1, sex: "ls", name: "男", age: 18, addr: "bar"}
	fmt.Println(b)

	var c Student = Student{2, "wr", "男", 19, "bar"}
	fmt.Println(c)

}
